import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:concert_ticket_client/app/constant/resp_code.dart';
import 'package:concert_ticket_client/app/model/resp/Resp.dart';
import 'package:concert_ticket_client/app/model/bo/user_model/UserModel.dart';
import 'package:concert_ticket_client/app/utils/network/http_util.dart';
import 'package:concert_ticket_client/app_config.dart';
import 'package:dio/dio.dart';
import 'package:get/get.dart';

dynamic getUserList() async{
  R r = await HttpUtil.get(
    urlSuffix: '/user/list',
  );
  List<UserModel> ansUserList = [];
  if (r.code == RespCode.SUCCESS) {
    for (var user in r.data) {
      ansUserList.add(UserModel.fromJson(user));
    }
  } else {
    print('获取用户列表失败: ${r.msg}');
    Get.dialog(Text('获取用户列表失败: ${r.msg}'));
  }
  return ansUserList;
}
